import java.util.*;

/**
 * 项目名称：wangxu
 * 类 名 称：HJ23
 * 描 述：
 * 创建时间：2023/3/10 4:37 下午
 * 创 建 人：wang-xu
 */
public class HJ23 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            String str = in.next();
            char[] chars = str.toCharArray();
            Map<Character,Integer> map = new HashMap<>();
            for (char key:chars) {
                if (!map.containsKey(key)){
                    map.put(key, 1);
                }else {
                    map.put(key, map.get(key)+1);
                }
            }
            Collection<Integer> val = map.values();
            Object[] cs =  val.toArray();
            Arrays.sort(cs);
            int min = (int) cs[0];
            List<Character> cList = new ArrayList<>();
            for (Map.Entry<Character,Integer> entry:map.entrySet()) {
                if (entry.getValue() == min){
                    cList.add(entry.getKey());
                }
            }
            for (Character c: cList){
                for (int i = 0; i <chars.length ; i++) {
                    if (chars[i]==c){
                        str = str.replace(String.valueOf(chars[i]),"");
                    }
                }
            }
            System.out.println(str);
        }
    }
}
